EntityManager = {}


function EntityManager:initialize()

	self.entities = {}
	self.actors = {}
	
	--[[
	
	local renderTable = MOAIRenderMgr.getRenderTable()
	table.insert ( renderTable, self.layer )
	MOAIRenderMgr.setRenderTable ( renderTable )
	]]


end

function EntityManager.new()

	local o = EntityManager:initialize()
	
	return o

end

function EntityManager:add_entity(entity)

	if entity.type ~= 'part' and entity.type ~= 'part_parent' then
		local iter = #self.entities+1
		self.entities[iter] = entity
	end
	
	return iter
end

function EntityManager:add_actor(actor)

	local iter = #self.actors+1
	self.actors[iter] = actor
	
	return iter

end

function EntityManager:remove_entity( entity_id )

	table.remove(self.entities, entity_id)


end

function EntityManager:remove_actor( actor_id )
	table.remove(self.actors, actor_id)

end



function EntityManager:get_actors()

	return self.actors

end

function EntityManager:get_entities()
	
	return self.entities

end



return EntityManager